import {setServer} from "@/utils/axios";
import {messageUrl} from "../../../url";
const messageRequest = setServer(messageUrl);

// 查询消息
export function getMessageChannel(query) {
  return messageRequest({
    url: '/data/channel/',
    method: 'get',
    params: query
  })
}

// 查询消息详情
export function getMessageChannelDetail(id) {
  return messageRequest({
    url: '/data/channel/'+id,
    method: 'get',
  })
}

// 获取消息类型
export function getMessageChannelType() {
  return messageRequest({
    url: '/data/channel/listNotice',
    method: 'get',
  })
}

// 获取消息下拉框
export function getAllMessageChannel() {
  return messageRequest({
    url: '/data/channel/listByName',
    method: 'get'
  })
}

// 新增消息
export function addMessageChannel(query) {
  return messageRequest({
    url: '/data/channel/',
    method: 'post',
    data: query
  })
}

// 修改消息
export function updateMessageChannel(query) {
  return messageRequest({
    url: '/data/channel/',
    method: 'put',
    data: query
  })
}

// 删除消息
export function deleteMessageChannel(id) {
  return messageRequest({
    url: '/data/channel/'+id,
    method: 'delete',
  })
}
